import request from '../../../utils/request';
import type { recordItem, ResTrademark } from './model';
//GET /admin/product/baseTrademark/{page}/{limit}

enum API {
  baseTrademark = '/admin/product/baseTrademark',
  updateTrademark = '/admin/product/baseTrademark/update',
  addTrademark = '/admin/product/baseTrademark/save',
  removeTrademark ='/admin/product/baseTrademark/remove/'
}

export const reqBaseTrademark = (page: number, limit: number) => {
  return request.get<any, ResTrademark>(
    API.baseTrademark + `/${page}/${limit}`
  );
};

export const reqAddOrUpdateTrademark = (trademark: recordItem) => {
  if (trademark.id) {
    return request.put(API.updateTrademark, trademark);
  } else {
    return request.post(API.addTrademark, trademark);
  }
};

// /admin/product/baseTrademark/remove/{id}
export const removeTrademark = (id:number)=>{
     return request.delete(API.removeTrademark+id)
}
